<script setup>
import HeaderComponent from '@/components/HeaderComponent.vue'
import FooterComponent from '@/components/FooterComponent.vue'
import UserCatgoryInfoSiderComponent from '@/components/UserCatgoryInfoSiderComponent.vue'

import { RouterLink } from 'vue-router'
import { ref } from 'vue'
import { RightCircleOutlined, LeftCircleOutlined, FieldTimeOutlined, TagOutlined, EditOutlined } from '@ant-design/icons-vue'

// 当前页码
const pageIndex = ref(2)
// 总页数
const pageSize = 50
</script>

<template>
	<HeaderComponent />
	<!-- 轮播图 -->
	<a-carousel autoplay arrows>
		<template #prevArrow>
			<div class="custom-slick-arrow" style="left: 10px; z-index: 1">
				<LeftCircleOutlined />
			</div>
		</template>
		<template #nextArrow>
			<div class="custom-slick-arrow" style="right: 10px">
				<RightCircleOutlined />
			</div>
		</template>
		<div class="carousel-item"><img src="@/assets/imgs/carousel/1.jpeg" /></div>
		<div class="carousel-item"><img src="@/assets/imgs/carousel/2.jpeg" /></div>
		<div class="carousel-item"><img src="@/assets/imgs/carousel/3.jpeg" /></div>
		<div class="carousel-item"><img src="@/assets/imgs/carousel/4.jpeg" /></div>
	</a-carousel>
	<!-- 主体内容 -->
	<a-layout>
		<a-layout class="post-box">
			<!-- 帖子列表 -->
			<a-layout-content class="post-content">
				<a-card v-for="item in 10">
					<RouterLink to="/details/1" target="_blank">
						<a-typography-text class="post-title" :ellipsis="true" content="再战个人博客 - 基于Vue+Express+ Ant Design Vue前后端分离， 基于Vue+Express+ Ant Design Vue前后端分离" />
					</RouterLink>
					<a-space class="post-info" size="large">
						<span>
							<EditOutlined />
							崔大洪
						</span>
						<span>
							<FieldTimeOutlined />
							2022-11-12
						</span>
						<span>
							<TagOutlined />
							MySQL性能分析
						</span>
					</a-space>
				</a-card>
				<!-- 分页 -->
				<a-flex class="page" justify="center">
					<a-pagination v-model:current="pageIndex" :total="pageSize" show-less-items />
				</a-flex>
			</a-layout-content>
			<!-- 帖子分类 -->
			<a-layout-sider theme="light" width="350px">
				<UserCatgoryInfoSiderComponent />
			</a-layout-sider>
		</a-layout>
		<a-divider style="margin: 0px" />
		<a-layout-footer>
			<FooterComponent />
		</a-layout-footer>
	</a-layout>
</template>

<style scoped>
/* 主体内容 */
.ant-layout.post-box {
	width: 85%;
	align-items: flex-start;
	margin: 0 auto;
}
.post-content {
	margin: 20px;
}
.post-info {
	color: #999;
	margin-top: 10px;
}
.ant-card {
	margin-bottom: 5px;
}
/* 左侧帖子列表 */
.post-title {
	font-size: 20px;
	width: 85%;
	cursor: pointer;
	font-weight: 400;
}
.post-title:hover {
	color: #ff7f00;
}
.page {
	margin-top: 20px;
}
/* 右侧分类 */
.post-box .ant-layout-sider {
	margin-top: 20px;
}

/* 轮播图 */
.ant-carousel {
	height: 400px;
}
.carousel-item img {
	width: 100%;
	height: 400px;
	object-fit: cover;
}

:deep(.slick-arrow.custom-slick-arrow) {
	width: 25px;
	height: 25px;
	font-size: 25px;
	color: #fff;
	background-color: rgba(31, 45, 61, 0.11);
	transition: ease all 0.3s;
	opacity: 0.3;
	z-index: 1;
}
:deep(.slick-arrow.custom-slick-arrow:before) {
	display: none;
}
:deep(.slick-arrow.custom-slick-arrow:hover) {
	color: #fff;
	opacity: 0.5;
}

:deep(.slick-slide h3) {
	color: #fff;
}
</style>
